package com.fap.search.meta.impl;

import java.util.ArrayList;
import java.util.List;

import com.fap.search.executor.IExecutor;
import com.fap.search.executor.impl.SqlExecutor;
import com.fap.search.meta.IFunctionMeta;
import com.fap.search.meta.ParameterMeta;

public class SqlFunctionMeta implements IFunctionMeta {

	private String _id;
	private List<ParameterMeta> _pms;
	private DataMeta _rm;
	public String sql;
	
	public SqlFunctionMeta(String id){
		_id = id.toLowerCase();
		_pms = new ArrayList<ParameterMeta>();
	}
	
	public IExecutor buildExecutor() {
		return new SqlExecutor(sql, _pms, _rm);
	}

	public String getId() {
		return _id;
	}

	public void addParameterMeta(ParameterMeta pm) {
		_pms.add(pm);
	}

	public void setDataMeta(DataMeta rm) {
		_rm = rm;
	}

}
